<!DOCTYPE HTML>
<html lang="zh-CN">


<head>
    <meta charset="utf-8">
    <meta name="keywords" content="gitlab">
    <meta name="description" content="GitLab是由GitLab Inc.开发，使用MIT许可证的基于网络的Git仓库管理工具，且具有wiki和issue跟踪功能。">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
    <meta name="renderer" content="webkit|ie-stand|ie-comp">
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
    <title>Linux搭建Gitlab服务 | 小沈曰</title>
    <link rel="icon" type="image/png" href="/favicon.png">

    <link rel="stylesheet" type="text/css" href="/libs/awesome/css/all.css">
    <link rel="stylesheet" type="text/css" href="/libs/materialize/materialize.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/aos/aos.css">
    <link rel="stylesheet" type="text/css" href="/libs/animate/animate.min.css">
    <link rel="stylesheet" type="text/css" href="/libs/lightGallery/css/lightgallery.min.css">
    <link rel="stylesheet" type="text/css" href="/css/matery.css">
    <link rel="stylesheet" type="text/css" href="/css/my.css">

    <script src="/libs/jquery/jquery.min.js"></script>
    
<meta name="generator" content="Hexo 4.2.0"><link rel="alternate" href="/xiaoshensay/atom.xml" title="小沈曰" type="application/atom+xml">
<link rel="stylesheet" href="/xiaoshensay/css/prism-tomorrow.css" type="text/css"></head>


<body>
    <header class="navbar-fixed">
    <nav id="headNav" class="bg-color nav-transparent">
        <div id="navContainer" class="nav-wrapper container">
            <div class="brand-logo">
                <a href="/xiaoshensay/" class="waves-effect waves-light">
                    
                    <img src="/medias/logo.png" class="logo-img" alt="LOGO">
                    
                    <span class="logo-span">小沈曰</span>
                </a>
            </div>
            

<a href="#" data-target="mobile-nav" class="sidenav-trigger button-collapse"><i class="fas fa-bars"></i></a>
<ul class="right nav-menu">
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/" class="waves-effect waves-light">
      
      <i class="fas fa-home" style="zoom: 0.6;"></i>
      
      <span>首页</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/tags" class="waves-effect waves-light">
      
      <i class="fas fa-tags" style="zoom: 0.6;"></i>
      
      <span>标签</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/categories" class="waves-effect waves-light">
      
      <i class="fas fa-bookmark" style="zoom: 0.6;"></i>
      
      <span>分类</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/archives" class="waves-effect waves-light">
      
      <i class="fas fa-archive" style="zoom: 0.6;"></i>
      
      <span>归档</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/about" class="waves-effect waves-light">
      
      <i class="fas fa-user-circle" style="zoom: 0.6;"></i>
      
      <span>关于</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/contact" class="waves-effect waves-light">
      
      <i class="fas fa-comments" style="zoom: 0.6;"></i>
      
      <span>留言板</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="/friends" class="waves-effect waves-light">
      
      <i class="fas fa-address-book" style="zoom: 0.6;"></i>
      
      <span>友情链接</span>
    </a>
    
  </li>
  
  <li class="hide-on-med-and-down nav-item">
    
    <a href="" class="waves-effect waves-light">

      
      <i class="fas fa-list" style="zoom: 0.6;"></i>
      
      <span>Medias</span>
      <i class="fas fa-chevron-down" aria-hidden="true" style="zoom: 0.6;"></i>
    </a>
    <ul class="sub-nav menus_item_child ">
      
      <li>
        <a href="/xiaoshensay/musics">
          
          <i class="fas fa-music" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Musics</span>
        </a>
      </li>
      
      <li>
        <a href="/xiaoshensay/movies">
          
          <i class="fas fa-film" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Movies</span>
        </a>
      </li>
      
      <li>
        <a href="/xiaoshensay/books">
          
          <i class="fas fa-book" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Books</span>
        </a>
      </li>
      
      <li>
        <a href="/xiaoshensay/galleries">
          
          <i class="fas fa-image" style="margin-top: -20px; zoom: 0.6;"></i>
          
          <span>Galleries</span>
        </a>
      </li>
      
    </ul>
    
  </li>
  
  <li>
    <a href="#searchModal" class="modal-trigger waves-effect waves-light">
      <i id="searchIcon" class="fas fa-search" title="搜索" style="zoom: 0.85;"></i>
    </a>
  </li>
</ul>

<div id="mobile-nav" class="side-nav sidenav">

    <div class="mobile-head bg-color">
        
        <img src="/medias/logo.png" class="logo-img circle responsive-img">
        
        <div class="logo-name">小沈曰</div>
        <div class="logo-desc">
            
            计算机,读书,菜谱,旅游,宠物
            
        </div>
    </div>

    

    <ul class="menu-list mobile-menu-list">
        
        <li class="m-nav-item">
	  
		<a href="/" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-home"></i>
			
			首页
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/tags" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-tags"></i>
			
			标签
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/categories" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-bookmark"></i>
			
			分类
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/archives" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-archive"></i>
			
			归档
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/about" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-user-circle"></i>
			
			关于
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/contact" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-comments"></i>
			
			留言板
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="/friends" class="waves-effect waves-light">
			
			    <i class="fa-fw fas fa-address-book"></i>
			
			友情链接
		</a>
          
        </li>
        
        <li class="m-nav-item">
	  
		<a href="javascript:;">
			
				<i class="fa-fw fas fa-list"></i>
			
			Medias
			<span class="m-icon"><i class="fas fa-chevron-right"></i></span>
		</a>
            <ul  style="background:  ;" >
              
                <li>   
				
                  <a href="/xiaoshensay/musics " style="margin-left:75px";>
				  
				   <i class="fa fas fa-music" style="position: absolute;left:50px" ></i>
			      
		          <span>Musics</span>
                  </a>
                </li>
              
                <li>   
				
                  <a href="/xiaoshensay/movies " style="margin-left:75px";>
				  
				   <i class="fa fas fa-film" style="position: absolute;left:50px" ></i>
			      
		          <span>Movies</span>
                  </a>
                </li>
              
                <li>   
				
                  <a href="/xiaoshensay/books " style="margin-left:75px";>
				  
				   <i class="fa fas fa-book" style="position: absolute;left:50px" ></i>
			      
		          <span>Books</span>
                  </a>
                </li>
              
                <li>   
				
                  <a href="/xiaoshensay/galleries " style="margin-left:75px";>
				  
				   <i class="fa fas fa-image" style="position: absolute;left:50px" ></i>
			      
		          <span>Galleries</span>
                  </a>
                </li>
               
            </ul>
          
        </li>
        
        
        <li><div class="divider"></div></li>
        <li>
            <a href="https://github.com/stszl" class="waves-effect waves-light" target="_blank">
                <i class="fab fa-github-square fa-fw"></i>Fork Me
            </a>
        </li>
        
    </ul>
</div>

        </div>

        
            <style>
    .nav-transparent .github-corner {
        display: none !important;
    }

    .github-corner {
        position: absolute;
        z-index: 10;
        top: 0;
        right: 0;
        border: 0;
        transform: scale(1.1);
    }

    .github-corner svg {
        color: #0f9d58;
        fill: #fff;
        height: 64px;
        width: 64px;
    }

    .github-corner:hover .octo-arm {
        animation: a 0.56s ease-in-out;
    }

    .github-corner .octo-arm {
        animation: none;
    }

    @keyframes a {
        0%,
        to {
            transform: rotate(0);
        }
        20%,
        60% {
            transform: rotate(-25deg);
        }
        40%,
        80% {
            transform: rotate(10deg);
        }
    }
</style>

<a href="https://github.com/stszl" class="github-corner tooltipped hide-on-med-and-down" target="_blank"
   data-tooltip="Fork Me" data-position="left" data-delay="50">
    <svg viewBox="0 0 250 250" aria-hidden="true">
        <path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path>
        <path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2"
              fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path>
        <path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z"
              fill="currentColor" class="octo-body"></path>
    </svg>
</a>
        
    </nav>

</header>

    
<script src="/libs/cryptojs/crypto-js.min.js"></script>
<script>
    (function() {
        let pwd = '';
        if (pwd && pwd.length > 0) {
            if (pwd !== CryptoJS.SHA256(prompt('请输入访问本文章的密码')).toString(CryptoJS.enc.Hex)) {
                alert('密码错误，将返回主页！');
                location.href = '/xiaoshensay/';
            }
        }
    })();
</script>




<div class="bg-cover pd-header post-cover" style="background-image: url('/medias/featureimages/101.jpg')">
    <div class="container" style="right: 0px;left: 0px;">
        <div class="row">
            <div class="col s12 m12 l12">
                <div class="brand">
                    <h1 class="description center-align post-title">Linux搭建Gitlab服务</h1>
                </div>
            </div>
        </div>
    </div>
</div>




<main class="post-container content">

    
    <link rel="stylesheet" href="/libs/tocbot/tocbot.css">
<style>
    #articleContent h1::before,
    #articleContent h2::before,
    #articleContent h3::before,
    #articleContent h4::before,
    #articleContent h5::before,
    #articleContent h6::before {
        display: block;
        content: " ";
        height: 100px;
        margin-top: -100px;
        visibility: hidden;
    }

    #articleContent :focus {
        outline: none;
    }

    .toc-fixed {
        position: fixed;
        top: 64px;
    }

    .toc-widget {
        width: 345px;
        padding-left: 20px;
    }

    .toc-widget .toc-title {
        margin: 35px 0 15px 0;
        padding-left: 17px;
        font-size: 1.5rem;
        font-weight: bold;
        line-height: 1.5rem;
    }

    .toc-widget ol {
        padding: 0;
        list-style: none;
    }

    #toc-content {
        height: calc(100vh - 250px);
        overflow: auto;
    }

    #toc-content ol {
        padding-left: 10px;
    }

    #toc-content ol li {
        padding-left: 10px;
    }

    #toc-content .toc-link:hover {
        color: #42b983;
        font-weight: 700;
        text-decoration: underline;
    }

    #toc-content .toc-link::before {
        background-color: transparent;
        max-height: 25px;
    }

    #toc-content .is-active-link {
        color: #42b983;
    }

    #toc-content .is-active-link::before {
        background-color: #42b983;
    }

    #floating-toc-btn {
        position: fixed;
        right: 15px;
        bottom: 76px;
        padding-top: 15px;
        margin-bottom: 0;
        z-index: 998;
    }

    #floating-toc-btn .btn-floating {
        width: 48px;
        height: 48px;
    }

    #floating-toc-btn .btn-floating i {
        line-height: 48px;
        font-size: 1.4rem;
    }
</style>
<div class="row">
    <div id="main-content" class="col s12 m12 l9">
        <!-- 文章内容详情 -->
<div id="artDetail">
    <div class="card">
        <div class="card-content article-info">
            <div class="row tag-cate">
                <div class="col s7">
                    
                    <div class="article-tag">
                        
                            <a href="/xiaoshensay/tags/%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86/">
                                <span class="chip bg-color">版本管理</span>
                            </a>
                        
                            <a href="/xiaoshensay/tags/Gitlab/">
                                <span class="chip bg-color">Gitlab</span>
                            </a>
                        
                    </div>
                    
                </div>
                <div class="col s5 right-align">
                    
                    <div class="post-cate">
                        <i class="fas fa-bookmark fa-fw icon-category"></i>
                        
                            <a href="/xiaoshensay/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA/" class="post-category">
                                计算机
                            </a>
                        
                    </div>
                    
                </div>
            </div>

            <div class="post-info">
                
                <div class="post-date info-break-policy">
                    <i class="far fa-calendar-minus fa-fw"></i>发布日期:&nbsp;&nbsp;
                    2020-01-01
                </div>
                

                

                
                <div class="info-break-policy">
                    <i class="far fa-file-word fa-fw"></i>文章字数:&nbsp;&nbsp;
                    1.8k
                </div>
                

                
                <div class="info-break-policy">
                    <i class="far fa-clock fa-fw"></i>阅读时长:&nbsp;&nbsp;
                    7 分
                </div>
                

                
                    <div id="busuanzi_container_page_pv" class="info-break-policy">
                        <i class="far fa-eye fa-fw"></i>阅读次数:&nbsp;&nbsp;
                        <span id="busuanzi_value_page_pv"></span>
                    </div>
				
            </div>

        </div>
        <hr class="clearfix">
        <div class="card-content article-card-content">
            <div id="articleContent">
                <h2 id="1-安装"><a href="#1-安装" class="headerlink" title="1. 安装"></a>1. 安装</h2><h3 id="1-1-配置yum源"><a href="#1-1-配置yum源" class="headerlink" title="1.1 配置yum源"></a>1.1 配置yum源</h3><blockquote>
<p>vim /etc/yum.repos.d/gitlab-ce.repo</p>
</blockquote>
<p>填写以下内容：</p>
<pre><code>[gitlab-ce]
name=Gitlab CE Repository
baseurl=https://mirrors.tuna.tsinghua.edu.cn/gitlab-ce/yum/el$releasever/
gpgcheck=0
enabled=1
</code></pre><h3 id="1-2-更新本地yum缓存"><a href="#1-2-更新本地yum缓存" class="headerlink" title="1.2 更新本地yum缓存"></a>1.2 更新本地yum缓存</h3><blockquote>
<p>yum makecache</p>
</blockquote>
<img width="80%" src="./images/1.png">

<h3 id="1-3-安装GitLab社区版"><a href="#1-3-安装GitLab社区版" class="headerlink" title="1.3 安装GitLab社区版"></a>1.3 安装GitLab社区版</h3><blockquote>
<p>yum install gitlab-ce #自动安装最新版本</p>
</blockquote>
<p><strong>注：若需安装指定版本，则添加版本号即可，如下</strong></p>
<blockquote>
<p>yum install gitlab-ce-x.x.x</p>
</blockquote>
<p>安装完成</p>
<img width="80%" src="./images/2.png">

<h2 id="2-开启GitLab"><a href="#2-开启GitLab" class="headerlink" title="2. 开启GitLab"></a>2. 开启GitLab</h2><blockquote>
<p>gitlab-ctl start</p>
</blockquote>
<h2 id="3-GitLab常用命令"><a href="#3-GitLab常用命令" class="headerlink" title="3. GitLab常用命令"></a>3. GitLab常用命令</h2><pre><code>gitlab-ctl start # 启动所有 gitlab 组件；
gitlab-ctl stop # 停止所有 gitlab 组件；
gitlab-ctl restart # 重启所有 gitlab 组件；
gitlab-ctl status # 查看服务状态；
gitlab-ctl reconfigure # 启动服务；（重新加载配置文件，在GitLab初次安装后可以使用，但是在业务环境中不可随意使用，reconfigure会把一些过去的config还原，导致修改的端口以及域名等都没有了。）
vim /etc/gitlab/gitlab.rb # 修改默认的配置文件；
gitlab-rake gitlab:check SANITIZE=true --trace # 检查gitlab；
sudo gitlab-ctl tail # 查看日志；</code></pre><h2 id="4-GitLab使用"><a href="#4-GitLab使用" class="headerlink" title="4. GitLab使用"></a>4. GitLab使用</h2><h3 id="4-1-访问GitLab"><a href="#4-1-访问GitLab" class="headerlink" title="4.1 访问GitLab"></a>4.1 访问GitLab</h3><p>在浏览器的地址栏中输入服务器的公网IP 192.168.7.34/ 即可显示GitLab的界面。<br><img width="80%" src="./images/3.png"></p>
<p><strong>注：若无法访问，则可以使用<code>ps -ef</code>命令查看服务是否正常启动。<br>若未启动， 则重新开启，若仍然启动不了，则可使用<code>gitlab-ctl reconfigure</code>（仅限初始环境下使用）命令启动服务， 然后再访问GitLab。</strong></p>
<h3 id="4-2-登陆gitlab"><a href="#4-2-登陆gitlab" class="headerlink" title="4.2 登陆gitlab"></a>4.2 登陆gitlab</h3><p>首次登录会强制用户修改密码，已设置为 123456。<br>密码修改成功后，输入用户名和密码进行登录，如果无法登陆，先去注册。<br>登陆成功后界面如下：<br><img width="80%" src="./images/4.png"></p>
<h3 id="4-3-创建Project"><a href="#4-3-创建Project" class="headerlink" title="4.3 创建Project"></a>4.3 创建Project</h3><ul>
<li><p>第一步 点击 create a project</p>
<img width="80%" src="./images/5.png">
</li>
<li><p>第二步 创建工程</p>
<img width="80%" src="./images/6.png">

</li>
</ul>
<p>创建完成如下<br><img width="80%" src="./images/7.png"></p>
<ul>
<li>第三步 克隆工程，验证工程是否获取成功</li>
</ul>
<pre><code>$ git clone http://192.168.7.34/szl/testproject.git
Cloning into 'testproject'...
Username for 'http://192.168.7.34': szl
Password for 'http://szl@192.168.7.34': 
remote: Enumerating objects: 3, done.
remote: Counting objects: 100% (3/3), done.
remote: Total 3 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (3/3), done.


$ cd testproject 

$ ls
README.md
</code></pre><h3 id="4-4-修改域名"><a href="#4-4-修改域名" class="headerlink" title="4.4 修改域名"></a>4.4 修改域名</h3><p>修改之前，显示的默认设置域名。<br><img width="80%" src="./images/8.png"></p>
<ul>
<li>第一步 修改host和port<br>由于没有DNS服务器，无法进行域名解析，所以需要将域名修改为主机名，进入终端修改一下文件即可。</li>
</ul>
<blockquote>
<p>vim /opt/gitlab/embedded/service/gitlab-rails/config/gitlab.yml</p>
</blockquote>
<p>修改host和port，可参考下面内容</p>
<pre><code>  ## GitLab settings
  gitlab:
    ## Web server settings (note: host is the FQDN, do not include http://)
    ## host: gitlab.example.com
    host: 192.168.7.34
    port: 80
    https: false</code></pre><ul>
<li>第二步 重启GitLab<blockquote>
<p>gitlab-ctl restart</p>
</blockquote>
</li>
</ul>
<ul>
<li>第三步 刷新GitLab页面查看是否修改成功<img width="80%" src="./images/9.png">

</li>
</ul>
<h3 id="4-5-删除Project"><a href="#4-5-删除Project" class="headerlink" title="4.5 删除Project"></a>4.5 删除Project</h3><ul>
<li><p>第一步 点击General，找到Advanced，点击Expand</p>
<img width="80%" src="./images/10.png">
</li>
<li><p>第二步 滚动到底部，点击Remove project</p>
<img width="80%" src="./images/11.png">
</li>
<li><p>第三步 在输入框中输入对应工程名称，点击Confirm</p>
<img width="80%" src="./images/12.png">

</li>
</ul>
<p>如果提示如下内容，表明工程已删除成功</p>
<pre><code>Project 'szl / testproject' is in the process of being deleted.</code></pre><p>如图所示<br><img width="80%" src="./images/13.png"></p>
<p>第四步：在浏览器输入对应工程路径，验证删除是否成功<br><img width="80%" src="./images/14.png"></p>
<h2 id="5-Gitlab备份与恢复"><a href="#5-Gitlab备份与恢复" class="headerlink" title="5. Gitlab备份与恢复"></a>5. Gitlab备份与恢复</h2><h3 id="5-1-GitLab创建备份"><a href="#5-1-GitLab创建备份" class="headerlink" title="5.1 GitLab创建备份"></a>5.1 GitLab创建备份</h3><blockquote>
<p>gitlab-rake gitlab:backup:create</p>
</blockquote>
<p>使用以上命令会默认在 <code>/var/opt/gitlab/backups</code> 目录下创建一个名称类似为1577333013_2019_12_26_12.6.0-ee_gitlab_backup.tar的压缩包, 这个压缩包就是Gitlab整个的完整部分, 其中开头的1577333013_2019_12_26_12.6.0是备份创建的日期。</p>
<pre><code>[root@localhost backups]# pwd
/var/opt/gitlab/backups
[root@localhost backups]# ls
1577333013_2019_12_26_12.6.0-ee_gitlab_backup.tar</code></pre><h3 id="5-2-删除project"><a href="#5-2-删除project" class="headerlink" title="5.2 删除project"></a>5.2 删除project</h3><p>删除一个已经备份的工程，操作步骤按照 4.5 删除Project</p>
<h3 id="5-3-GitLab恢复"><a href="#5-3-GitLab恢复" class="headerlink" title="5.3 GitLab恢复"></a>5.3 GitLab恢复</h3><ul>
<li>第一步 停止相关数据连接服务<blockquote>
<p>gitlab-ctl stop unicorn<br>gitlab-ctl stop sidekiq</p>
</blockquote>
</li>
</ul>
<p>如图所示：<br><img width="80%" src="./images/15.png"></p>
<ul>
<li>第二步 从1577333013_2019_12_26_12.6.0-ee编号备份中恢复<blockquote>
<p>gitlab-rake gitlab:backup:restore BACKUP=1577333013_2019_12_26_12.6.0-ee</p>
</blockquote>
</li>
</ul>
<h3 id="5-4-启动Gitlab"><a href="#5-4-启动Gitlab" class="headerlink" title="5.4 启动Gitlab"></a>5.4 启动Gitlab</h3><blockquote>
<p>gitlab-ctl start</p>
</blockquote>
<h3 id="5-5-查看GitLab页面中是否恢复project"><a href="#5-5-查看GitLab页面中是否恢复project" class="headerlink" title="5.5 查看GitLab页面中是否恢复project"></a>5.5 查看GitLab页面中是否恢复project</h3><p>刷新之前删除的工程，如果工程恢复，表明备份已恢复成功。</p>
<h2 id="6-Gitlab-修改备份文件默认目录"><a href="#6-Gitlab-修改备份文件默认目录" class="headerlink" title="6. Gitlab 修改备份文件默认目录"></a>6. Gitlab 修改备份文件默认目录</h2><p>可以通过修改<code>/etc/gitlab/gitlab.rb</code>来修改默认存放备份文件的目录。</p>
<blockquote>
<p>vim /etc/gitlab/gitlab.rb</p>
</blockquote>
<p>修改下面内容：</p>
<pre><code>gitlab_rails['backup_path'] = "/mnt/gitlab/backup" &gt;&gt;修改文件路径即可</code></pre><p>修改完成之后使用<code>gitlab-ctl reconfigure</code>命令重载配置文件即可。</p>
<p><strong>注意：因为涉及到重新加载配置，reconfigure会把一些过去的config还原，导致修改的端口以及域名等都没有了。建议在服务安装之后即修改仓库默认路径，若后期业务中修改此项，会对业务造成一定的影响。若后期业务需修改此项，请提前做好准备，然后再修改配置文件中的相应参数。</strong></p>
<p>重载配置文件之后会发现/mnt/gitlab/backup的权限发生变化<br><img width="80%" src="./images/16.png"></p>
<h2 id="7-修改仓库的默认路径"><a href="#7-修改仓库的默认路径" class="headerlink" title="7. 修改仓库的默认路径"></a>7. 修改仓库的默认路径</h2><h3 id="7-1-修改配置文件，找到git-data-dirs"><a href="#7-1-修改配置文件，找到git-data-dirs" class="headerlink" title="7.1 修改配置文件，找到git_data_dirs"></a>7.1 修改配置文件，找到<code>git_data_dirs</code></h3><blockquote>
<p>vim /etc/gitlab/gitlab.rb</p>
</blockquote>
<pre><code># git_data_dirs({
#   "default" =&gt; {
#     "path" =&gt; "/mnt/nfs-01/git-data"
#    }
# })
git_data_dir "/data/gitlab"   &gt;&gt;此处添加自定义的仓库路径，目录需提前创建</code></pre><p>在<code>git_data_dir</code>下面添加一句<code>git_data_dir "/data/gitlab"</code></p>
<h3 id="7-2-停止当前gitlab，重新加载配置"><a href="#7-2-停止当前gitlab，重新加载配置" class="headerlink" title="7.2 停止当前gitlab，重新加载配置"></a>7.2 停止当前gitlab，重新加载配置</h3><p><strong>注意：仓库路径的修改会导致已有project的丢失，请提前进行备份，具体备份操作请参考上文“GitLab的备份与恢复”，然后再修改配置文件中的相应参数。</strong></p>
<blockquote>
<p>gitlab-ctl stop<br>gitlab-ctl reconfigure</p>
</blockquote>
<h3 id="7-3-重新加载"><a href="#7-3-重新加载" class="headerlink" title="7.3 重新加载"></a>7.3 重新加载</h3><p>会发现在<code>/data/gitlab</code>目录下多出一个repositories目录</p>
<h3 id="7-4-最后启动gitlab即可"><a href="#7-4-最后启动gitlab即可" class="headerlink" title="7.4 最后启动gitlab即可"></a>7.4 最后启动gitlab即可</h3><blockquote>
<p>gitlab-ctl start</p>
</blockquote>
<h2 id="8-GitLab服务端口修改"><a href="#8-GitLab服务端口修改" class="headerlink" title="8. GitLab服务端口修改"></a>8. GitLab服务端口修改</h2><p>yum方式安装的GitLab的配置文件路径为<code>/var/opt/gitlab/nginx/conf</code>（其他安装方式的配置文件路径不一定相同，请自行查找）。</p>
<h3 id="8-1-修改配置文件"><a href="#8-1-修改配置文件" class="headerlink" title="8.1 修改配置文件"></a>8.1 修改配置文件</h3><blockquote>
<p>vim /var/opt/gitlab/nginx/conf/gitlab-http.conf</p>
</blockquote>
<pre><code>###################################
##         configuration         ##
###################################

upstream gitlab-workhorse {
  server unix:/var/opt/gitlab/gitlab-workhorse/socket;
}
server {
  listen *:8888;   &gt;&gt; 此处修改端口即可</code></pre><h3 id="8-2-重启服务"><a href="#8-2-重启服务" class="headerlink" title="8.2 重启服务"></a>8.2 重启服务</h3><blockquote>
<p>gitlab-ctl restart</p>
</blockquote>
<h3 id="8-3-访问ip-port，查看页面是否正常"><a href="#8-3-访问ip-port，查看页面是否正常" class="headerlink" title="8.3 访问ip:port，查看页面是否正常"></a>8.3 访问ip:port，查看页面是否正常</h3><p><strong>注意</strong></p>
<ol>
<li>端口修改之后，project中的IP也需要相应的修改，请参考上文“修改域名”，修改port参数即可。</li>
<li>执行gitlab-ctl reconfigure命令后，配置文件会重新加载，服务端口会重新恢复为默认端口80，所以，如需修改端口，请在上述两个步骤之后进行操作。</li>
<li>Gitlab部署中注意端口不要冲突。</li>
</ol>
<h2 id="9-其他博客"><a href="#9-其他博客" class="headerlink" title="9. 其他博客"></a>9. 其他博客</h2><p>Centos 7搭建Gitlab服务器超详细<br><a href="https://blog.csdn.net/duyusean/article/details/80011540" target="_blank" rel="noopener">https://blog.csdn.net/duyusean/article/details/80011540</a></p>
<p>配置ssh的步骤：<br><a href="https://blog.csdn.net/xyzchenxiaolin/article/details/51852333" target="_blank" rel="noopener">https://blog.csdn.net/xyzchenxiaolin/article/details/51852333</a></p>
<p>有时不仅需要修改external_url的端口，还要修改unicorn<br><a href="https://blog.csdn.net/fengchao2016/article/details/77851234" target="_blank" rel="noopener">https://blog.csdn.net/fengchao2016/article/details/77851234</a></p>
<p>修改git文件存放路径<br><a href="https://www.cnblogs.com/dieyaxianju/p/7586203.html" target="_blank" rel="noopener">https://www.cnblogs.com/dieyaxianju/p/7586203.html</a></p>
<p>设置发送邮件的功能<br>参考链接：<a href="http://www.fayfox.com/post/39.html" target="_blank" rel="noopener">http://www.fayfox.com/post/39.html</a><br>邮箱配置官方文档：<a href="https://docs.gitlab.com/omnibus/settings/smtp.html#mandrill" target="_blank" rel="noopener">https://docs.gitlab.com/omnibus/settings/smtp.html#mandrill</a><br>安装后的测试：<a href="https://blog.csdn.net/yelllowcong/article/details/79939589" target="_blank" rel="noopener">https://blog.csdn.net/yelllowcong/article/details/79939589</a><br>如果测试不成功，请参照这篇文章：<a href="https://ruby-china.org/topics/20450（要将身份验证帐号和发件人保持一致。）" target="_blank" rel="noopener">https://ruby-china.org/topics/20450（要将身份验证帐号和发件人保持一致。）</a></p>
<script>
        document.querySelectorAll('.github-emoji')
          .forEach(el => {
            if (!el.dataset.src) { return; }
            const img = document.createElement('img');
            img.style = 'display:none !important;';
            img.src = el.dataset.src;
            img.addEventListener('error', () => {
              img.remove();
              el.style.color = 'inherit';
              el.style.backgroundImage = 'none';
              el.style.background = 'none';
            });
            img.addEventListener('load', () => {
              img.remove();
            });
            document.body.appendChild(img);
          });
      </script>
            </div>
            <hr/>

            

    <div class="reprint" id="reprint-statement">
        
            <div class="reprint__author">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-user">
                        文章作者:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://shenzhaoliang.gitee.io" rel="external nofollow noreferrer">小沈</a>
                </span>
            </div>
            <div class="reprint__type">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-link">
                        文章链接:
                    </i>
                </span>
                <span class="reprint-info">
                    <a href="https://shenzhaoliang.gitee.io/xiaoshensay/2020/01/01/gitlab/">https://shenzhaoliang.gitee.io/xiaoshensay/2020/01/01/gitlab/</a>
                </span>
            </div>
            <div class="reprint__notice">
                <span class="reprint-meta" style="font-weight: bold;">
                    <i class="fas fa-copyright">
                        版权声明:
                    </i>
                </span>
                <span class="reprint-info">
                    本博客所有文章除特別声明外，均采用
                    <a href="https://creativecommons.org/licenses/by/4.0/deed.zh" rel="external nofollow noreferrer" target="_blank">CC BY 4.0</a>
                    许可协议。转载请注明来源
                    <a href="https://shenzhaoliang.gitee.io" target="_blank">小沈</a>
                    !
                </span>
            </div>
        
    </div>

    <script async defer>
      document.addEventListener("copy", function (e) {
        let toastHTML = '<span>复制成功，请遵循本文的转载规则</span><button class="btn-flat toast-action" onclick="navToReprintStatement()" style="font-size: smaller">查看</a>';
        M.toast({html: toastHTML})
      });

      function navToReprintStatement() {
        $("html, body").animate({scrollTop: $("#reprint-statement").offset().top - 80}, 800);
      }
    </script>



            <div class="tag_share" style="display: block;">
                <div class="post-meta__tag-list" style="display: inline-block;">
                    
                        <div class="article-tag">
                            
                                <a href="/xiaoshensay/tags/%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86/">
                                    <span class="chip bg-color">版本管理</span>
                                </a>
                            
                                <a href="/xiaoshensay/tags/Gitlab/">
                                    <span class="chip bg-color">Gitlab</span>
                                </a>
                            
                        </div>
                    
                </div>
                <div class="post_share" style="zoom: 80%; width: fit-content; display: inline-block; float: right; margin: -0.15rem 0;">
                    <link rel="stylesheet" type="text/css" href="/libs/share/css/share.min.css">

<div id="article-share">
    
    
    <div class="social-share" data-sites="qq,qzone,wechat,weibo,douban,linkedin" data-wechat-qrcode-helper="<p>微信扫一扫即可分享！</p>"></div>
    <script src="/libs/share/js/social-share.min.js"></script>
    

    

</div>

                </div>
            </div>
            
                <style>
    #reward {
        margin: 40px 0;
        text-align: center;
    }

    #reward .reward-link {
        font-size: 1.4rem;
        line-height: 38px;
    }

    #reward .btn-floating:hover {
        box-shadow: 0 6px 12px rgba(0, 0, 0, 0.2), 0 5px 15px rgba(0, 0, 0, 0.2);
    }

    #rewardModal {
        width: 320px;
        height: 350px;
    }

    #rewardModal .reward-title {
        margin: 15px auto;
        padding-bottom: 5px;
    }

    #rewardModal .modal-content {
        padding: 10px;
    }

    #rewardModal .close {
        position: absolute;
        right: 15px;
        top: 15px;
        color: rgba(0, 0, 0, 0.5);
        font-size: 1.3rem;
        line-height: 20px;
        cursor: pointer;
    }

    #rewardModal .close:hover {
        color: #ef5350;
        transform: scale(1.3);
        -moz-transform:scale(1.3);
        -webkit-transform:scale(1.3);
        -o-transform:scale(1.3);
    }

    #rewardModal .reward-tabs {
        margin: 0 auto;
        width: 210px;
    }

    .reward-tabs .tabs {
        height: 38px;
        margin: 10px auto;
        padding-left: 0;
    }

    .reward-content ul {
        padding-left: 0 !important;
    }

    .reward-tabs .tabs .tab {
        height: 38px;
        line-height: 38px;
    }

    .reward-tabs .tab a {
        color: #fff;
        background-color: #ccc;
    }

    .reward-tabs .tab a:hover {
        background-color: #ccc;
        color: #fff;
    }

    .reward-tabs .wechat-tab .active {
        color: #fff !important;
        background-color: #22AB38 !important;
    }

    .reward-tabs .alipay-tab .active {
        color: #fff !important;
        background-color: #019FE8 !important;
    }

    .reward-tabs .reward-img {
        width: 210px;
        height: 210px;
    }
</style>

<div id="reward">
    <a href="#rewardModal" class="reward-link modal-trigger btn-floating btn-medium waves-effect waves-light red">赏</a>

    <!-- Modal Structure -->
    <div id="rewardModal" class="modal">
        <div class="modal-content">
            <a class="close modal-close"><i class="fas fa-times"></i></a>
            <h4 class="reward-title">你的赏识是我前进的动力</h4>
            <div class="reward-content">
                <div class="reward-tabs">
                    <ul class="tabs row">
                        <li class="tab col s6 alipay-tab waves-effect waves-light"><a href="#alipay">支付宝</a></li>
                        <li class="tab col s6 wechat-tab waves-effect waves-light"><a href="#wechat">微 信</a></li>
                    </ul>
                    <div id="alipay">
                        <img src="/medias/reward/alipay.jpg" class="reward-img" alt="支付宝打赏二维码">
                    </div>
                    <div id="wechat">
                        <img src="/medias/reward/wechat.png" class="reward-img" alt="微信打赏二维码">
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>

<script>
    $(function () {
        $('.tabs').tabs();
    });
</script>
            
        </div>
    </div>

    
        <link rel="stylesheet" href="/libs/gitalk/gitalk.css">
<link rel="stylesheet" href="/css/my-gitalk.css">

<div class="card gitalk-card" data-aos="fade-up">
    <div class="comment_headling" style="font-size: 20px; font-weight: 700; position: relative; left: 20px; top: 15px; padding-bottom: 5px;">
        <i class="fas fa-comments fa-fw" aria-hidden="true"></i>
        <span>评论</span>
    </div>
    <div id="gitalk-container" class="card-content"></div>
</div>

<script src="/libs/gitalk/gitalk.min.js"></script>
<script>
    let gitalk = new Gitalk({
        clientID: '',
        clientSecret: '',
        repo: '',
        owner: '',
        admin: null,
        id: '2020-01-01T22-46-45',
        distractionFreeMode: false  // Facebook-like distraction free mode
    });

    gitalk.render('gitalk-container');
</script>
    

    

    

    

    

    

<article id="prenext-posts" class="prev-next articles">
    <div class="row article-row">
        
        <div class="article col s12 m6" data-aos="fade-up" data-aos="fade-up">
            <div class="article-badge left-badge text-color">
                <i class="far fa-dot-circle"></i>&nbsp;本篇
            </div>
            <div class="card">
                <a href="/xiaoshensay/2020/01/01/gitlab/">
                    <div class="card-image">
                        
                        <img src="/medias/featureimages/101.jpg" class="responsive-img" alt="Linux搭建Gitlab服务">
                        
                        <span class="card-title">Linux搭建Gitlab服务</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            GitLab是由GitLab Inc.开发，使用MIT许可证的基于网络的Git仓库管理工具，且具有wiki和issue跟踪功能。
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2020-01-01
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/xiaoshensay/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA/" class="post-category">
                                    计算机
                                </a>
                            
                            
                        </span>
                    </div>
                </div>

                
                <div class="card-action article-tags">
                    
                    <a href="/xiaoshensay/tags/%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86/">
                        <span class="chip bg-color">版本管理</span>
                    </a>
                    
                    <a href="/xiaoshensay/tags/Gitlab/">
                        <span class="chip bg-color">Gitlab</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
        
        <div class="article col s12 m6" data-aos="fade-up">
            <div class="article-badge right-badge text-color">
                下一篇&nbsp;<i class="fas fa-chevron-right"></i>
            </div>
            <div class="card">
                <a href="/xiaoshensay/2019/06/23/git/">
                    <div class="card-image">
                        
                        <img src="/medias/featureimages/100.jpg" class="responsive-img" alt="Git">
                        
                        <span class="card-title">Git</span>
                    </div>
                </a>
                <div class="card-content article-content">
                    <div class="summary block-with-text">
                        
                            Git是一个版本管理控制系统（缩写VCS），它可以在任何时间点，将文档的状态作为更新记录保存起来，也可以在任何时间点，将更新记录恢复回来。
                        
                    </div>
                    <div class="publish-info">
                            <span class="publish-date">
                                <i class="far fa-clock fa-fw icon-date"></i>2019-06-23
                            </span>
                        <span class="publish-author">
                            
                            <i class="fas fa-bookmark fa-fw icon-category"></i>
                            
                            <a href="/xiaoshensay/categories/%E8%AE%A1%E7%AE%97%E6%9C%BA/" class="post-category">
                                    计算机
                                </a>
                            
                            
                        </span>
                    </div>
                </div>
                
                <div class="card-action article-tags">
                    
                    <a href="/xiaoshensay/tags/%E7%89%88%E6%9C%AC%E7%AE%A1%E7%90%86/">
                        <span class="chip bg-color">版本管理</span>
                    </a>
                    
                </div>
                
            </div>
        </div>
        
    </div>
</article>

</div>



<!-- 代码块功能依赖 -->
<script type="text/javascript" src="/libs/codeBlock/codeBlockFuction.js"></script>

<!-- 代码语言 -->

<script type="text/javascript" src="/libs/codeBlock/codeLang.js"></script>


<!-- 代码块复制 -->

<script type="text/javascript" src="/libs/codeBlock/codeCopy.js"></script>


<!-- 代码块收缩 -->

<script type="text/javascript" src="/libs/codeBlock/codeShrink.js"></script>


<!-- 代码块折行 -->

<style type="text/css">
code[class*="language-"], pre[class*="language-"] { white-space: pre !important; }
</style>


    </div>
    <div id="toc-aside" class="expanded col l3 hide-on-med-and-down">
        <div class="toc-widget">
            <div class="toc-title"><i class="far fa-list-alt"></i>&nbsp;&nbsp;目录</div>
            <div id="toc-content"></div>
        </div>
    </div>
</div>

<!-- TOC 悬浮按钮. -->

<div id="floating-toc-btn" class="hide-on-med-and-down">
    <a class="btn-floating btn-large bg-color">
        <i class="fas fa-list-ul"></i>
    </a>
</div>


<script src="/libs/tocbot/tocbot.min.js"></script>
<script>
    $(function () {
        tocbot.init({
            tocSelector: '#toc-content',
            contentSelector: '#articleContent',
            headingsOffset: -($(window).height() * 0.4 - 45),
            collapseDepth: Number('3'),
            headingSelector: 'h1, h2, h3, h4'
        });

        // modify the toc link href to support Chinese.
        let i = 0;
        let tocHeading = 'toc-heading-';
        $('#toc-content a').each(function () {
            $(this).attr('href', '#' + tocHeading + (++i));
        });

        // modify the heading title id to support Chinese.
        i = 0;
        $('#articleContent').children('h1, h2, h3, h4').each(function () {
            $(this).attr('id', tocHeading + (++i));
        });

        // Set scroll toc fixed.
        let tocHeight = parseInt($(window).height() * 0.4 - 64);
        let $tocWidget = $('.toc-widget');
        $(window).scroll(function () {
            let scroll = $(window).scrollTop();
            /* add post toc fixed. */
            if (scroll > tocHeight) {
                $tocWidget.addClass('toc-fixed');
            } else {
                $tocWidget.removeClass('toc-fixed');
            }
        });

        
        /* 修复文章卡片 div 的宽度. */
        let fixPostCardWidth = function (srcId, targetId) {
            let srcDiv = $('#' + srcId);
            if (srcDiv.length === 0) {
                return;
            }

            let w = srcDiv.width();
            if (w >= 450) {
                w = w + 21;
            } else if (w >= 350 && w < 450) {
                w = w + 18;
            } else if (w >= 300 && w < 350) {
                w = w + 16;
            } else {
                w = w + 14;
            }
            $('#' + targetId).width(w);
        };

        // 切换TOC目录展开收缩的相关操作.
        const expandedClass = 'expanded';
        let $tocAside = $('#toc-aside');
        let $mainContent = $('#main-content');
        $('#floating-toc-btn .btn-floating').click(function () {
            if ($tocAside.hasClass(expandedClass)) {
                $tocAside.removeClass(expandedClass).hide();
                $mainContent.removeClass('l9');
            } else {
                $tocAside.addClass(expandedClass).show();
                $mainContent.addClass('l9');
            }
            fixPostCardWidth('artDetail', 'prenext-posts');
        });
        
    });
</script>

    

</main>



    <footer class="page-footer bg-color">
    
        <link rel="stylesheet" href="/libs/aplayer/APlayer.min.css">
<div class="">
    
    <div class="row">
        <meting-js class="col l8 offset-l2 m10 offset-m1 s12"
                   server="netease"
                   type="playlist"
                   id="955411580"
                   fixed='true'
                   autoplay='false'
                   theme:='#42b983'
                   loop='all'
                   order='random'
                   preload='auto'
                   volume='0.7'
                   list-folded='true'
        >
        </meting-js>
    </div>
</div>

<script src="/libs/aplayer/APlayer.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/meting@2/dist/Meting.min.js"></script>

    
    <div class="container row center-align" style="margin-bottom: 0px !important;">
        <div class="col s12 m8 l8 copy-right">
            Copyright&nbsp;&copy;
            <span id="year">2019</span>
            <a href="https://shenzhaoliang.gitee.io" target="_blank">小沈</a>
            |&nbsp;Powered by&nbsp;<a href="https://hexo.io/" target="_blank">Hexo</a>
            |&nbsp;Theme&nbsp;<a href="https://github.com/blinkfox/hexo-theme-matery" target="_blank">Matery</a>
            <br>
            
            &nbsp;<i class="fas fa-chart-area"></i>&nbsp;站点总字数:&nbsp;<span
                class="white-color">31.5k</span>&nbsp;字
            
            
            
            
            
            
            <span id="busuanzi_container_site_pv">
                |&nbsp;<i class="far fa-eye"></i>&nbsp;总访问量:&nbsp;<span id="busuanzi_value_site_pv"
                    class="white-color"></span>&nbsp;次
            </span>
            
            
            <span id="busuanzi_container_site_uv">
                |&nbsp;<i class="fas fa-users"></i>&nbsp;总访问人数:&nbsp;<span id="busuanzi_value_site_uv"
                    class="white-color"></span>&nbsp;人
            </span>
            
            <br>
            
            <br>
            
        </div>
        <div class="col s12 m4 l4 social-link social-statis">
    <a href="https://github.com/stszl" class="tooltipped" target="_blank" data-tooltip="访问我的GitHub" data-position="top" data-delay="50">
        <i class="fab fa-github"></i>
    </a>



    <a href="mailto:stszl@sina.cn" class="tooltipped" target="_blank" data-tooltip="邮件联系我" data-position="top" data-delay="50">
        <i class="fas fa-envelope-open"></i>
    </a>







    <a href="tencent://AddContact/?fromId=50&fromSubId=1&subcmd=all&uin=409178030" class="tooltipped" target="_blank" data-tooltip="QQ联系我: 409178030" data-position="top" data-delay="50">
        <i class="fab fa-qq"></i>
    </a>







    <a href="/xiaoshensay/atom.xml" class="tooltipped" target="_blank" data-tooltip="RSS 订阅" data-position="top" data-delay="50">
        <i class="fas fa-rss"></i>
    </a>

</div>
    </div>
</footer>

<div class="progress-bar"></div>


    <!-- 搜索遮罩框 -->
<div id="searchModal" class="modal">
    <div class="modal-content">
        <div class="search-header">
            <span class="title"><i class="fas fa-search"></i>&nbsp;&nbsp;搜索</span>
            <input type="search" id="searchInput" name="s" placeholder="请输入搜索的关键字"
                   class="search-input">
        </div>
        <div id="searchResult"></div>
    </div>
</div>

<script src="/js/search.js"></script>
<script type="text/javascript">
$(function () {
    searchFunc("/xiaoshensay/" + "search.xml", 'searchInput', 'searchResult');
});
</script>
    <!-- 回到顶部按钮 -->
<div id="backTop" class="top-scroll">
    <a class="btn-floating btn-large waves-effect waves-light" href="#!">
        <i class="fas fa-arrow-up"></i>
    </a>
</div>


    <script src="/libs/materialize/materialize.min.js"></script>
    <script src="/libs/masonry/masonry.pkgd.min.js"></script>
    <script src="/libs/aos/aos.js"></script>
    <script src="/libs/scrollprogress/scrollProgress.min.js"></script>
    <script src="/libs/lightGallery/js/lightgallery-all.min.js"></script>
    <script src="/js/matery.js"></script>

    <!-- Global site tag (gtag.js) - Google Analytics -->


    <!-- Baidu Analytics -->

    <!-- Baidu Push -->

<script>
    (function () {
        var bp = document.createElement('script');
        var curProtocol = window.location.protocol.split(':')[0];
        if (curProtocol === 'https') {
            bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
        } else {
            bp.src = 'http://push.zhanzhang.baidu.com/push.js';
        }
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(bp, s);
    })();
</script>

    
    <script src="/libs/others/clicklove.js" async="async"></script>
    
    
    <script async src="/libs/others/busuanzi.pure.mini.js"></script>
    

    

    

    

    

    
    
    
    <script src="/libs/instantpage/instantpage.js" type="module"></script>
    

</body>

</html>
